USE [Example.Repository]
GO

IF EXISTS (SELECT * FROM sys.views WHERE [name]=N'resources')
	BEGIN
	DROP VIEW [dbo].[resources]
	END
GO

CREATE VIEW [dbo].[resources]
AS
SELECT
	 o.[urn]
	,CAST(o.[status] AS CHAR(3)) + ' ' + s.[value] AS [status]
	,c.[value] AS [cacheability]
	,o.[expires]
	,o.[modified]
	,o.[etag]
	,(t.[name] + ', ' + a.[name]) AS [type]
	,o.[xml]
FROM [dbo].[object] AS o
	INNER JOIN [dbo].[status] AS s ON s.[identity] = o.[status]
	INNER JOIN [dbo].[cacheability] AS c ON c.[identity] = o.[cacheability]
	INNER JOIN [dbo].[type] AS t ON t.[identity] = o.[type]
	INNER JOIN [dbo].[assembly] AS a ON a.[identity] = t.[assembly]
GO